package com.gdut.huayan.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gdut.huayan.validation.NumRange;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

@Data
@TableName("t_refund_detail")
public class RefundDetail {

    @TableId(value = "id", type = IdType.AUTO)
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Long id;

    /**
     * 联合退款订单
     */
    private Long refundId;

    /**
     * 对应的子订单id
     */
    @NotNull(message = "请填写子订单id")
    private Long orderDetailId;

    /**
     * 退款原因
     */
    private String reason;

    /**
     * 拒绝原因
     */
    private String replyMessage;

    /**
     * 用户要求退款金额
     */
    private Integer requireMoneyAmount;

    /**
     * 管理员实际要求退款金额
     */
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Integer actualMoneyAmount;

    /**
     * 退款状态
     * 1- 退款中 2- 已退款 3- 已拒绝 4-退款失败
     */
    @NumRange(min = 1,max = 3)
    private Integer status;

}
